<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru" lang="ru">

<head><title>Subscribers</title>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
    <link href="css/common.css" rel="stylesheet" type="text/css">
</head>

<body>
<f:view>
    <f:loadBundle basename="ResourceBundle" var="bundle"/>
    <h:form id="audioContentForm">
        <div id="external">
            <div id="menu">
                <h:outputText value="#{bundle.menu_title}"/>
                <br>
                <%@ include file="menu.jsp" %>
            </div>
            <div id="languages">
                <div class="internal-languages">
                    <strong>
                        <h:commandLink value="EN"/>
                        <h:commandLink value="HI"/>
                        <h:commandLink value="TAM"/>
                    </strong>
                </div>
            </div>


            <div id="content">
                <div id="title"> ${bundle.userDB_header}</div>

                <div style=" position:absolute; top:7%; height: 18%; left: 2%; width: 40%; background-color: #7ccff5;">
                    <br>
                    <h:outputText value="#{bundle.find_content_by_id}"/>
                    <h:inputText value="#{audioContentBean.filterId}" style="width: 50px"/>
                    <h:commandButton value="#{bundle.ok_button}" style="width:50px"/>

                    <br>
                    <h:outputText value="#{bundle.find_by_MSISDN}"/>
                    <h:inputText value="#{audioContentBean.filterName}"/>
                    <h:commandButton value="#{bundle.ok_button}" style="width:50px"/>
                </div>
                <div style="position:absolute; top:7%;height: 18%;left: 44%; width: 25%; background-color:  #7ccff5; text-align: center;">
                    <h:outputText value="#{bundle.find_user_by_bonus}"/>
                    <br>
                    <h:outputText value="#{bundle.from}"/>
                    <h:inputText value="#{audioContentBean.filterId}"/>
                    <br>
                    <h:outputText value="#{bundle.to}"/>
                    &nbsp; &nbsp;
                    <h:inputText value="#{audioContentBean.filterId}"/>
                    <br>
                    <h:commandButton value="#{bundle.ok_button}" style="width: 70px"/>
                </div>
                <div style="position:absolute; top:7%;height: 18%;left: 71%; width: 25%; background-color:  #7ccff5; text-align: right;">
                    <br>
                    <h:outputText value="#{bundle.rowCountOnPage}"/>
                    <h:inputText style="width: 100px"/> <br>
                    <h:commandButton value="#{bundle.ok_button}" style="width:50px"/>
                    <br>
                    <h:outputText value="#{bundle.fullRowCount}"/>
                    <h:inputText value="4" style="width: 100px"/>
                    <br>
                </div>

                <div id="data-table">
                    <h:dataTable value="#{userBean.userDecorators}" var="user" border="1" width="100%"
                                 headerClass="table-header">
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="user_ID"/>
                            </f:facet>
                            <h:outputText value="#{user.userID}"/>
                        </h:column>

                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="MSISDN"/>
                            </f:facet>
                            <h:outputText value="#{user.MSISDN}"/>
                        </h:column>

                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="Sex"/>
                            </f:facet>
                            <h:outputText value="#{user.sex}"/>
                        </h:column>

                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="Age"/>
                            </f:facet>
                            <h:outputText value="#{user.age}"/>
                        </h:column>

                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="ARPU"/>
                            </f:facet>
                            <h:outputText value="#{user.ARPU}"/>
                        </h:column>

                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="Region"/>
                            </f:facet>
                            <h:outputText value="#{user.region}"/>
                        </h:column>

                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="Activity"/>
                            </f:facet>
                            <h:outputText value="#{user.activity}"/>
                        </h:column>

                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="Bonuses"/>
                            </f:facet>
                            <h:outputText value="#{user.bonus}"/>
                        </h:column>

                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="Registration date"/>
                            </f:facet>
                            <h:outputText value="#{user.registrationDate}"/>
                        </h:column>

                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="Restore password"/>
                            </f:facet>
                            <h:commandButton value="#{bundle.restoreButton}"
                                             onclick="alert('Password was sent via SMS')"/>
                        </h:column>

                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="Edit"/>
                            </f:facet>
                            <h:commandButton value="#{bundle.edit_button}" action="#{userBean.editUser}">
                                <f:param name="edit_user" value="#{user.userID}"/>
                            </h:commandButton>
                        </h:column>
                    </h:dataTable>
                </div>

                <div id="page-navigation">${bundle.navigation}</div>
                <div style="position:absolute;top: 60%; height: 5%; right: 5%">
                    <h:commandButton value="#{bundle.addButton}" action="#{userBean.addUser}"/>
                </div>


                <div style="    position: absolute;float: left;background-color:#7ccff5; bottom: 2%; height: 23%; left:2%; width: 30%;">
                    <strong><h:outputText value="#{bundle.choosing_by_region}:"/></strong>

                    <div style="height:60%; overflow-y:scroll; word-wrap:break-word">
                        <h:panelGrid columns="2">
                            <h:selectManyCheckbox value="#{userBean.chosenFilterRegions}" layout="pageDirection"
                                                  style="width: 100%">
                                <f:selectItems value="#{userBean.regions}"/>
                            </h:selectManyCheckbox>
                        </h:panelGrid>
                    </div>
                    <div style="height:20pt">
                        <h:panelGrid columns="2">
                            <h:commandButton value="#{bundle.checkAllButton}"
                                             actionListener="#{userBean.checkAllRegions}"/>
                            <h:commandButton value="#{bundle.uncheckAllButton}"
                                             actionListener="#{userBean.clearAllRegions}"/>
                        </h:panelGrid>
                    </div>
                </div>

                <div style="position: absolute;float: left;background-color:#7ccff5; bottom: 2%; height: 23%;left:34%; width: 25%;">
                    <div id="statuses-filters-inside">
                        <h:outputText value="#{bundle.choosing_by_status}"/>
                        <br>
                        <h:selectOneMenu value="#{audioContentBean.chosenStatus}">
                            <f:selectItems value="#{audioContentBean.statuses}"/>
                        </h:selectOneMenu>
                        <br>
                        <h:commandButton value="#{bundle.ok_button}"/>
                    </div>
                </div>

                <div style="position: absolute; float: left; background-color:#7ccff5; bottom: 2%; height: 23%; right:2%; width: 35%">
                    <strong><h:outputText value="#{bundle.choosing_by_group}:"/></strong>

                    <div style="height:100px; overflow-y:scroll; word-wrap:break-word; vertical-align: middle;">
                        <h:panelGrid columns="2">
                            <h:selectManyCheckbox layout="pageDirection" value="#{userBean.chosenFilterGroups}"
                                                  style="width: 100%">
                                <f:selectItems value="#{userBean.groups}"/>
                            </h:selectManyCheckbox>
                        </h:panelGrid>
                    </div>
                    <div style="height:20pt">
                        <h:panelGrid columns="2">
                            <h:commandButton value="#{bundle.checkAllButton}"
                                             actionListener="#{userBean.checkAllGroups}"/>
                            <h:commandButton value="#{bundle.uncheckAllButton}"
                                             actionListener="#{userBean.clearAllGroups}"/>
                        </h:panelGrid>
                        <h:commandButton value="#{bundle.ok_button}"/>
                    </div>
                </div>
            </div>
        </div>
    </h:form>
</f:view>
</body>
</html>
